#ifndef ICONTOOL_H
#define ICONTOOL_H

#include <QObject>
#include <QQmlEngine>
#include <QPixmap>
#include <QImage>
#include <QPainter>
#include <QtSvg/QSvgRenderer>
#include "imageprovider.h"

class IconTool : public QObject
{
    Q_OBJECT
    QML_ELEMENT
public:
    explicit IconTool(QObject *parent = nullptr);

    Q_INVOKABLE QPixmap load_pixmap();

    Q_INVOKABLE QImage load_img();

    Q_INVOKABLE QUrl render_svg(const QByteArray& svg);

    Q_INVOKABLE bool save_icon();

    Q_INVOKABLE QUrl load_clipboard();

    Q_INVOKABLE QUrl load_from_file(const QUrl& url);
signals:

private:
//    bool modify_svg_style()
private:
    QImage img_;
    QSvgRenderer svg_renderer_;
    qint32 img_id_;
};

#endif // ICONTOOL_H
